function defineProperty(obj, key, value) {
    return key in obj ? Object.defineProperty(obj, key, {
        value: value,
        enumerable: !0,
        configurable: !0,
        writable: !0
    }) : obj[key] = value, obj;
}

function mapProperties(source, target, mapping) {
    Object.keys(mapping).forEach(function(key) {
        source[key] && (target[mapping[key]] = source[key]);
    });
}

Object.defineProperty(exports, "__esModule", {
    value: !0
}), exports.VantComponent = void 0;

var a = require("../mixins/basic"), t = require("../mixins/observer/index");

exports.VantComponent = function() {
    var options = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {}, componentOptions = {};
    mapProperties(options, componentOptions, {
        data: "data",
        props: "properties",
        mixins: "behaviors",
        methods: "methods",
        beforeCreate: "created",
        created: "attached",
        mounted: "ready",
        relations: "relations",
        destroyed: "detached",
        classes: "externalClasses"
    });
    var relation = options.relation;
    relation && (componentOptions.relations = Object.assign(componentOptions.relations || {}, defineProperty({}, "../" + relation.name + "/index", relation))), 
    componentOptions.externalClasses = componentOptions.externalClasses || [], componentOptions.externalClasses.push("custom-class"), 
    componentOptions.behaviors = componentOptions.behaviors || [], componentOptions.behaviors.push(a.basic), 
    options.field && componentOptions.behaviors.push("wx://form-field"), 
    componentOptions.options = {
        multipleSlots: !0,
        addGlobalClass: !0
    }, (0, t.observe)(options, componentOptions), Component(componentOptions);
};